package com.yanqu.road.entity.activity.commonsupport.config;

import com.yanqu.road.entity.activity.ActivityConfig;
import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.enums.eActivityConfigType;
import com.yanqu.road.utils.string.StringUtils;

import java.util.List;
import java.util.Map;

public class CommonUnionSupportConfig {

    private int supportSwitch;

    private String reward;

    private List<Integer> supportTimeList;

    private ActivityInfo activityInfo;

    public CommonUnionSupportConfig(ActivityInfo activityInfo, Map<String, ActivityConfig> activityConfigMap) {
        this.activityInfo = activityInfo;
        supportSwitch = activityConfigMap.get(eActivityConfigType.ACTIVITY_SUPPORT_SWITCH.getName()).getIntValue();
        reward = activityConfigMap.get(eActivityConfigType.ACTIVITY_SUPPORT_REWARD.getName()).getValue();
        supportTimeList = StringUtils.stringToIntegerList(activityConfigMap.get(eActivityConfigType.ACTIVITY_SUPPORT_TIME.getName()).getValue(), "\\|");
    }


    public int getSupportSwitch() {
        return supportSwitch;
    }

    public void setSupportSwitch(int supportSwitch) {
        this.supportSwitch = supportSwitch;
    }

    public String getReward() {
        return reward;
    }

    public void setReward(String reward) {
        this.reward = reward;
    }

    public List<Integer> getSupportTimeList() {
        return supportTimeList;
    }

    public void setSupportTimeList(List<Integer> supportTimeList) {
        this.supportTimeList = supportTimeList;
    }

    public ActivityInfo getActivityInfo() {
        return activityInfo;
    }
}
